<template>
	<view class="coupon-view">
		<page-head :transparent='true'>
			<slot slot="title">{{title.length>10?title.substr(0,10)+'...':title}}</slot>
			<slot slot="right">{{''}}</slot>
		</page-head>
		<view class="coupon-main-row" @click="onClick"></view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				title: '免费领券'
			}
		},
		methods: {
			async onClick() {
				try {
					uni.request({
						url: this.$serverUrl + '/coupon-expand/customer/quotatotal/deduction/quota',
						method: 'POST',
						header: {
							'blade-auth': decodeURI(uni.getStorageSync('token')) || decodeURI(UrlParam().token),
							'content-type': 'application/x-www-form-urlencoded'
						},
						data: {
							amount: 200
						},
						success: res => {
							let code = res.data.code;
							uni.showModal({
								title: '',
								content: res.data.msg,
								showCancel: false,
								cancelText: '取消',
								confirmText: '朕已阅',
								success: res => {

								}
							});
						}
					});
				} catch (e) {
					console.log("e==" + e)
				}
			}
		},
	}
</script>

<style lang="scss">
	.coupon-view {
		background-image: url('../../static/img/search/get.gif');
		width: 100%;
		height: 100%;
		position: fixed;
		/* z-index: -10; */
		background-repeat: no-repeat;
		background-position: 0px 0px;
		background-size: 100% 100%;
		font-size: 30upx;
		font-family: Helvetica, Verdana, sans-serif, 'STKaiti', 'STHeiti', 'DFKai-SB', 'KaiTi';

		.coupon-main-row {
			width: 100%;
			height: 100%;
		}
	}
</style>
